In conventional technology, there have been known, Japanese Patent Laid-Open Publication No. SHO 60-229113 or 58-124907 or SHO 60-83110 which disclose method and apparatus for detecting a contact between a tool and a work. According to Japanese Patent Laid-Open Publication No. SHO 60-229113, a contact is detected according to a change in the voltage of a servo motor used for feeding the main shaft and a contact position is detected according to an output of a position detector. On the other hand, according to Japanese Patent Laid-Open Publication No. SHO 58-124907 or SHO 60-83110, contact between a slide table and a stopper fixed at a specified position or a stroke restricting section (a reference position setting member) is detected according to a fact that a current flowing through a motor for driving a slide table in the axial direction becomes an excessive current and a contact position is detected according to an output current of a position detector.
In the method and apparatus based on the conventional technology as described above, when a motor voltage or a motor current exceeds a specified value, it is determined that a movable body, such as a tool or a slide table, has established a contact with an object, such as a work or a reference position setting member. Therefore, it may be wrongly determined that a contact between the body and the object has been established when a motor voltage or a motor current exceeds the specified value because of load fluctuations due to an external disturbance or change in mechanical viscosity.
Furthermore, detection of fluctuations in motor load is troublesome because it is affected by cyclical load fluctuation, chalking torque in the motor, or motor load fluctuation caused by a feed screw, which makes it impossible to detect a contact position with high precision.